<?php
/**
 * Template Name: 友情链接
 * 
 */
get_header(); ?>
<main class="main bg-light pb-4">
	<div class="container-fluid">
		<div class="row">
			<div class="banner-panel text-center" style="background-image: url(<?php echo grace_option('image_default_tag'); ?>);">
				<h1 class="wow bounceInLeft">友情链接</h1>
				<p class="wow bounceInRight pt-2 px-3">这里有一些志同道合的网站！</p>
			</div>
		</div>
	</div>
	<div class="container pt-4">
		<div class="category-list row">
			<?php
				$bookmarks = get_bookmarks();
				if (count($bookmarks) == 0){?>
					<div class="jumbotron container">
						<h2 class="display-3">真的很抱歉！</h2>
						<p class="lead">这里一片空白，没有任何内容，你愿意来填满它吗？</p>
							<hr class="m-y-md">
						<p>东风夜放花千树。更吹落、星如雨。宝马雕车香满路。凤箫声动，玉壶光转，一夜鱼龙舞。<br />
							蛾儿雪柳黄金缕。笑语盈盈暗香去。众里寻他千百度。蓦然回首，那人却在，灯火阑珊处。</p>
						<p class="lead">
							<a class="btn btn-primary btn-lg" href="<?php echo wp_login_url( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ); ?>" role="button">我来填满</a>
						</p>
					</div>
				<?php
				}else{
				foreach ($bookmarks as $bookmark) { ?>
					<article class="col-md-6 col-xl-4 category-item">
						<div class="alpha-item globe-block">
							<div class="card">
								<div class="card-header">
								    <a href="<?php echo $bookmark->link_url; ?>" target="<?php echo $bookmark->link_target; ?>" class="pull-left"><i class="fa fa-link mr-3"></i><?php echo $bookmark->link_name; ?>
									</a>
								</div>
								<div class="card card-block text-center">
									<p class="card-text card-content"><?php echo $bookmark->link_description; ?></p>
								</div>
								<div class="card-footer text-muted">
									<a href="<?php echo $bookmark->link_url; ?>" target="<?php echo $bookmark->link_target; ?>"><i class="fa fa-link mr-3"></i>前往访问</a>
								</div>
							</div>
						</div>
					</article>
			<?php }}	?>
		</div>
	</div>
</main>
<?php get_footer(); ?>